package com.itheima.reggie.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.reggie.common.Result;
import com.itheima.reggie.entity.ShoppingCart;

import java.util.List;

/**
 * @author Yan
 */
public interface ShoppingCartService extends IService<ShoppingCart> {
    /**
     * 添加购物车
     * @param shoppingCart
     * @return
     */
    Result<ShoppingCart> addShoppingCart(ShoppingCart shoppingCart);

    /**
     * 根据当前用户id查询购物车里
     * @return
     */
    Result<List<ShoppingCart>> shoppingCartList();

    /**
     * 清空回收站
     * @return
     */
    Result<String> clean();

    /**
     * 修改购物车中商品数量-1
     * @param shoppingCart
     * @return
     */
    Result<ShoppingCart> sub(ShoppingCart shoppingCart);
}